package com.nl.lib_core.tool

/** 作者: wangfei 创建时间: 2021/11/9 包名: com.nl.module_detail.contract 类名: JsonServiceImpl */
// @Route(path = "/service/JsonServiceImpl")
// open class JsonServiceImpl : SerializationService {
//    private var gson: Gson? = null
//    override fun init(context: Context) {
//        if (gson == null){gson = Gson()}
//    }
//    override fun <T> json2Object(text: String, clazz: Class<T>): T? {
//        return gson?.fromJson(text,clazz)
//    }
//    override fun object2Json(instance: Any): String {
//        return try {
//            gson?.toJson(instance).toString()
//        }catch (e:Exception){
//          Log.e("object2Json",e.printStackTrace().toString()).toString()
//        }
//    }
//    override fun <T : Any?> parseObject(input: String?, clazz: Type?): T? {
//        return gson?.fromJson(input,clazz)
//    }
// }
